package com.dubbo.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.service.Address2Service;
import com.dubbo.service.LoginService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author chenluqiang
 * @date 2019/4/13
 */
@Service
@com.alibaba.dubbo.config.annotation.Service
public class Address2ServiceImpl implements Address2Service {

    @Reference
    private LoginService loginService;

    @Override
    public Map<String, Object> list() {
        Map<String,Object> map = new HashMap<>();
        if(!loginService.isLogin()){
            map.put("code","501");
            map.put("msg","请重新登陆！");
            return map;
        }
        map.put("code","200");
        map.put("data","[{'id':'1','name':'hass'}]");
        return map;
    }

    @Override
    public boolean isRightAddress() {
        return true;
    }
}
